#ifndef PARPORT_H
#define PARPORT_H

#define     NEGO_NIBBLE     0x04
#define     NEGO_EPP        0x40

void debug_pport(uint32_t base);
void write_control_port(uint32_t base, uint8_t value);
uint8_t read_control_port(uint32_t base);
void write_epp_addr(uint32_t base, uint8_t data);
void write_epp_data(uint32_t base, uint8_t data);
uint8_t read_epp_data(uint32_t base);
int wait_status1(uint32_t base);
int wait_status_ack(uint32_t base);
int wait_status_ack_noerror(uint32_t base);
uint8_t read_nibble_from_status(uint32_t base);
int read_nibble(uint32_t base, uint8_t *out);
bool xfer_data_epp(uint32_t base, uint32_t reg_num, uint8_t *out);
int read_register_epp(uint32_t base, uint32_t addr, uint8_t *out);
int write_register_epp(uint32_t base, uint32_t addr, uint8_t data);

#endif /* PARPORT_H */
